<!-- 分类 -->
<template>
  <div>
    <!-- 标题栏 -->
    <MainNavBar title=""> </MainNavBar>
    <div>
      <van-tree-select
        height="80vh"
        :items="menuList"
        @click-item="onitemclick"
        :main-active-index.sync="activeIndex"
      />
    </div>
  </div>
</template>

<script>
import MainNavBar from "@/components/MainNavBar";
import { mapState, mapMutations, mapGetters, mapActions } from "vuex";
import { getAddRouter } from "@/router/routerUtil";

export default {
  name: "Categories",
  components: {
    MainNavBar
  },
  props: {},
  data() {
    return {
      placeholder: "请输入内容", // 搜索框提示
      activeIndex: 0,
      rightBtn: {
        // header 右侧按钮
        number: 1, // 按钮数量
        iconName: ["chat-o"]
      },
      dataList: []
    };
  },
  computed: {
    ...mapState({
      // 动态主路由
      menuList: state => getAddRouter()
    })
  },
  watch: {},
  methods: {
    onitemclick(data) {
      this.$router.push(data.path);
    }
  }
};
</script>

<style scoped lang="less">
.van-sidebar-item--select::before {
  height: 100%;
}
</style>
